package com.github.itdachen.quartz.job;

import com.github.itdachen.framework.core.utils.LocalDateUtils;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

/**
 * 测试任务
 *
 * @author 剑鸣秋朔
 * @date 2025/11/21 21:17
 */
@DisallowConcurrentExecution // 禁止并发
public class SpringBootQuartzJob implements Job {

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {

        System.out.println(LocalDateUtils.getLocalDateTime() + " Quartz Job 开始 。。。");
         try {
             Thread.sleep(3000);
         } catch (InterruptedException e) {
             e.printStackTrace();
         }
        System.out.println(LocalDateUtils.getLocalDateTime() + " Quartz Job 结束");
    }
}
